import type { AppBuilderOptions } from '../../typing';

import ElectronRunner from './scripts/electron';
/**
 * @Description:自定义启动方式
 * @Author: lishibin
 * @Date: 12:19 2022/1/9
 * @version : V0.0.1-beta
 */

const RunnerBuilder = {
  build(cfg: AppBuilderOptions) {
    const kind = cfg?.target;
    let runner;
    switch (kind) {
      case 'electron': {
        console.log('electron runner');
        runner = new ElectronRunner(cfg);
        break;
      }
      default: {
        throw new Error(`unknown kind --- ${kind}`);
      }
    }
    return runner;
  },
};

export default RunnerBuilder;
